import { Layer } from "./core/layer";
import { Graphic } from "./graphic/type";

export default class DataStorage {
	shapeList: Layer[];
	constructor() {
		this.shapeList = [];
	}
	getData() {
		return this.shapeList;
	}
	addLayer(shape: Layer) {
		this.shapeList.push(shape);
	}
	delLayer(shape: Layer) {
		let delLayer;
		const delIndex = this.shapeList.findIndex(shapes => shapes === shape);
		if (delIndex < 0) {
			return;
		}
		delLayer = this.shapeList.splice(delIndex, 1);
		return delLayer
	}
}
